from pyecharts.charts import Bar
from pyecharts.render import make_snapshot
# pip install snapshot-selenium
from snapshot_selenium import snapshot

bar_chart = Bar()
bar_chart.add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"])
bar_chart.add_yaxis('一季度', [5, 20, 36, 10, 10, 20])
bar_chart.add_yaxis('二季度', [15, 21, 13, 15, 9, 25])
bar_chart.add_yaxis('三季度', [16, 24, 33, 8, 9, 17])
bar_chart.add_yaxis('四季度', [15, 30, 9, 17, 18, 5])
# bar_chart.render()

make_snapshot(snapshot, bar_chart.render(), 'sales.png')
